<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterWhitelistToMicroAppsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('micro_apps', function (Blueprint $table) {
            $table->renameColumn('whitelist', 'whitelist_ips');
            $table->text('whitelist_domains')->nullable()->comment('域名白名单');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('micro_apps', function (Blueprint $table) {
            $table->renameColumn('whitelist_ips', 'whitelist');
            $table->dropColumn('whitelist_domains');
        });
    }
}
